﻿CREATE PROCEDURE [dbo].[proc_Employee_WageTempZj_GetList_BackUp]
	(
		@StartIndex int,
		@EndIndex int,
		@CompanyId int,
		@EName nvarchar(50)
	)
AS
	Begin
								
		;WITH list As(Select ROW_NUMBER() OVER (ORDER BY Employee_WageTempZj.Id DESC)AS Row, 
			Id
			,CompanyId
			,CompanyName
			,UserName
			,EName
			,CategoryId
			,CategoryName
			,Price
			,Memo
			,FsDate
			,CreateName
			,CreateDate
--@XFL
--			,(Select Count(Id) From	Employee_WageTempZj	Where  (@CompanyId=0 or CompanyId = @CompanyId) and EName Like '%'+@EName+'%'	) AS Count_Sum	
		From
			Employee_WageTempZj
		Where 
			 (@CompanyId=0 or CompanyId = @CompanyId)
			 and EName Like '%'+@EName+'%'			    
		)
		Select *,(select count(0) from list) AS Count_Sum	 From list Where Row between @StartIndex and @EndIndex 						    
	End
	RETURN
